<?php #//v.3.3.0

#///////////////////////////////////////////////////////
#//  COPYRIGHT 2007 Phpauction.net ALL RIGHTS RESERVED//
#///////////////////////////////////////////////////////

require('./includes/config.inc.php');
  $closed = 1;
$paid = 0;
$current_bidder =  $_SESSION['PHPAUCTION_LOGGED_IN_USERNAME'];

// GET UNPAID PAYMENTS       $temp_query="SELECT * FROM `orders` WHERE `cust`='$cust' AND `job`='$jobname' AND `worder`='$worder'";

$query = "select * from PHPAUCTIONXL_auctions where paid=$paid AND current_high_bidder='$current_bidder' AND closed=$closed ORDER BY ends DESC";
$result_numbids = mysql_query ($query);
$num_auction2 = mysql_num_rows($result_numbids);

 $ii = 0;
             $tplv = "";

while($ii < $num_auction2) {

       $ends_h = "";

      if($rowclass == 0)
 
 { 
 $rowbackground = "row0";

 }
              
      if($rowclass == 1)
  { 
 $rowbackground = "row1";

$rowclass = -1;
 }        


$rowclass++;



      

$high_bid 	= mysql_result($result_numbids,$ii,"current_bid");
$auction_id = mysql_result($result_numbids,$ii,"id");
$title = mysql_result($result_numbids,$ii,"title");     
$reserve_price = mysql_result($result_numbids,$ii,"reserve_price"); 
$win_limit = mysql_result($result_numbids,$ii,"winlimit");   
            
            if ( $reserve_price < $high_bid ) {
             
                 $tplv .= "<tr VALIGN=MIDDLE BGCOLOR=\"\" id=$rowbackground>";

$tplv .= "<td><a href=\"item.php?id=".$auction_id."\">$title</a></td>";
       
                    $bid = $currency_symbol.print_money_nosymbol($high_bid);

                       $tplv .=
                       "<td align=center>".
                       $bid.
                        "</td>";

                   if ( $winlimit == 0 ) {

         $tplv .= "<td align=center><a href=auction_payment.php?id=$auction_id>$WIN_HISTORY_MAKE_PAYMENT</A></td>";

         }
                        
                               if ( $winlimit == 1 ) {

         $tplv .= "<td align=center>Daily Win Limit Exceeded</td>";

         }
                                             if ( $winlimit == 2 ) {

         $tplv .= "<td align=center>Weekly Win Limit Exceeded</td>";

         }
                                        if ( $winlimit == 3 ) {

         $tplv .= "<td align=center>Monthly Win Limit Exceeded</td>";

         }
                       $tplv .= "</tr>\r";    
                       
                       
                       
                       
                       
                               }
             
$ii++;

}
                      //$tplv .= "</TABLE>";  
              $unpaid_value = $tplv;



 // GET Pending PAYMENTS

$query = "select * from PHPAUCTIONXL_payments where userid='$_SESSION[PHPAUCTION_LOGGED_IN]' AND status='Pending' ORDER BY date DESC";
$result_numbids = mysql_query ($query);
$num_auction2 = mysql_num_rows($result_numbids);

 $ii = 0;
             $tplv = "";

while($ii < $num_auction2) {

       $ends_h = "";

      if($rowclass == 0)
 
 { 
 $rowbackground = "row0";

 }
              
      if($rowclass == 1)
  { 
 $rowbackground = "row1";

$rowclass = -1;
 }        


$rowclass++;



      

$date = mysql_result($result_numbids,$ii,"date"); 
$amount	= mysql_result($result_numbids,$ii,"amount");
$itemtype = mysql_result($result_numbids,$ii,"itemtype");
$auction_id = mysql_result($result_numbids,$ii,"itemid");
$itemname = mysql_result($result_numbids,$ii,"itemname");     

                                $tplv .= "<tr VALIGN=MIDDLE BGCOLOR=\"\" id=$rowbackground>";

    if($itemtype != "Bid-Pack")        {

$tplv .= "<td ALIGN=LEFT><a href=\"item.php?id=".$auction_id."\">$itemname</a></td>";
                            }
   
       if($itemtype == "Bid-Pack")        {

$tplv .= "<td ALIGN=left><a href=\"\">$itemname</a></td>";
                            }
       
       
   $tplv .= "<td  ALIGN=center>";    
    
$tplv .= substr ($date, 4, 2);
$tplv .= "/";
$tplv .= substr ($date, 6, 2);
$tplv .= "/";
$tplv .= substr ($date, 0, 4);
  $tplv .= "</td>"; 
  
      
              $bid = $currency_symbol.print_money_nosymbol($amount);

                       $tplv .=
                       "<td align=center>".
                       $bid.
                        "</td>";

         $tplv .= "<td align=center>$PAYMENT_HISTORY_PENDING_APPROVAL</td>";

                       $tplv .= "</tr>\r";    
             
             
$ii++;

}
                      //$tplv .= "</TABLE>";  
              $pending_value = $tplv;


    // GET Pending PAYMENTS

$query = "select * from PHPAUCTIONXL_payments where userid='$_SESSION[PHPAUCTION_LOGGED_IN]' AND status='Completed' ORDER BY date DESC";
$result_numbids = mysql_query ($query);
$num_auction2 = mysql_num_rows($result_numbids);

 $ii = 0;
             $tplv = "";

while($ii < $num_auction2) {

       $ends_h = "";

      if($rowclass == 0)
 
 { 
 $rowbackground = "row0";

 }
              
      if($rowclass == 1)
  { 
 $rowbackground = "row1";

$rowclass = -1;
 }        


$rowclass++;



      

$date = mysql_result($result_numbids,$ii,"date"); 
$amount	= mysql_result($result_numbids,$ii,"amount");
$itemtype = mysql_result($result_numbids,$ii,"itemtype");
$auction_id = mysql_result($result_numbids,$ii,"itemid");
$itemname = mysql_result($result_numbids,$ii,"itemname");     

$tplv .= "<tr VALIGN=MIDDLE BGCOLOR=\"\" id=$rowbackground>";

    if($itemtype != "Bid-Pack")        {

$tplv .= "<td ALIGN=LEFT><a href=\"item.php?id=".$auction_id."\">$itemname</a></td>";
                            }
   
       if($itemtype == "Bid-Pack")        {

$tplv .= "<td ALIGN=LEFT><a href=\"\">$itemname</a></td>";
                            }
       
       
         $tplv .= "<td  ALIGN=center>";    
    
$tplv .= substr ($date, 4, 2);
$tplv .= "/";
$tplv .= substr ($date, 6, 2);
$tplv .= "/";
$tplv .= substr ($date, 0, 4);
  $tplv .= "</td>";  
       
       
       
       
             $bid = $currency_symbol.print_money_nosymbol($amount);

         
         
         
         
         
                       $tplv .=
                       "<td align=center>".
                      
                       $bid.
                        "</td>";

         $tplv .= "<td align=center>$PAYMENT_HISTORY_PAYMENT_COMPLETE</td>";

                       $tplv .= "</tr>\r";    
             
             
$ii++;

}
                      //$tplv .= "</TABLE>";  
              $completed_value = $tplv;




    

include "header.php";
include phpa_include("template_payments_php.html");
include "footer.php";

?>